Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/[Sugar-devel] [PATCH Speak] Use radians instead of degrees.eml
blob: 74de1472760bbf8318f95a7359a718baa679bcd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Delivered-To: dirakx@gmail.com
Received: by 10.216.203.201 with SMTP id f51csp157443weo;
        Mon, 29 Oct 2012 09:28:57 -0700 (PDT)
Received: by 10.229.172.10 with SMTP id j10mr4535433qcz.97.1351528136584;
        Mon, 29 Oct 2012 09:28:56 -0700 (PDT)
Return-Path: <sugar-devel-bounces@lists.sugarlabs.org>
Received: from sunjammer.sugarlabs.org ([2001:4830:134:7::11])
        by mx.google.com with ESMTP id l13si3106854qct.106.2012.10.29.09.28.54;
        Mon, 29 Oct 2012 09:28:56 -0700 (PDT)
Received-SPF: neutral (google.com: 2001:4830:134:7::11 is neither permitted nor denied by best guess record for domain of sugar-devel-bounces@lists.sugarlabs.org) client-ip=2001:4830:134:7::11;
Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:4830:134:7::11 is neither permitted nor denied by best guess record for domain of sugar-devel-bounces@lists.sugarlabs.org) smtp.mail=sugar-devel-bounces@lists.sugarlabs.org; dkim=neutral (body hash did not verify) header.i=@gmail.com
Received: from sunjammer.sugarlabs.org (localhost [127.0.0.1])
	by sunjammer.sugarlabs.org (Postfix) with ESMTP id 8CC3C1207C1;
	Mon, 29 Oct 2012 12:28:52 -0400 (EDT)
Received: from mail-gg0-f170.google.com (mail-gg0-f170.google.com
	[209.85.161.170])
	by sunjammer.sugarlabs.org (Postfix) with ESMTPS id 3B2971207BA
	for <sugar-devel@lists.sugarlabs.org>;
	Mon, 29 Oct 2012 12:28:44 -0400 (EDT)
Received: by mail-gg0-f170.google.com with SMTP id q6so1007326ggc.29
	for <sugar-devel@lists.sugarlabs.org>;
	Mon, 29 Oct 2012 09:28:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer;
	bh=Tl9HWRlci2fx5ly+T/w/KiybW5Lplry1Gzbb6e/9Gyk=;
	b=FzDU3vhswJR5kySlOzionb/KOWic4TbkHdrTB+arxoG1bzvkdtVl2VgqnHyIb/Rb6Z
	JzcVWPsSBX1Lp5EH+E74ihoBcGlyv+JhiVf427eRV+PkgMoZ5zmnu7xtDAzOa2K/s9I6
	StRL/whisudZid+ezHGjkPdhfyoR6Q8Xu/plP8NCU+LIVLpO5dAIgpyoFpPtZ3CKWwq5
	C2tVp0ez3CYDh5xIX2VF4QBPdIpEAhy7CjD8Y+MBT5zTeLnjwHXODw5k+0PPqDf7YiVq
	wDf/zOPJIsPede5VPfFAjXhHaJ33lfKoid0QPgO4f4oxAXhPRsJf2vb7OIYiB6jej+YR
	eLeA==
Received: by 10.236.47.41 with SMTP id s29mr8283441yhb.20.1351528123824;
	Mon, 29 Oct 2012 09:28:43 -0700 (PDT)
Received: from michifus.humitos.dyndns.org (201-213-135-73.net.prima.net.ar.
	[201.213.135.73])
	by mx.google.com with ESMTPS id s19sm8937181anh.17.2012.10.29.09.28.32
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 29 Oct 2012 09:28:33 -0700 (PDT)
From: Manuel Kaufmann <humitos@gmail.com>
To: rafael@activitycentral.com
Date: Mon, 29 Oct 2012 13:28:23 -0300
Message-Id: <1351528103-12020-1-git-send-email-humitos@gmail.com>
X-Mailer: git-send-email 1.7.11.7
X-Spam-Status: No, score=-0.7 required=3.5 tests=FREEMAIL_FROM,
	RCVD_IN_DNSWL_LOW, SPF_PASS,
	T_DKIM_INVALID autolearn=unavailable version=3.3.2
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	sunjammer.sugarlabs.org
X-Topics: Patches and patch reviews
Cc: Manuel Kaufmann <humitos@gmail.com>, sugar-devel@lists.sugarlabs.org
Subject: [Sugar-devel] [PATCH Speak] Use radians instead of degrees
X-BeenThere: sugar-devel@lists.sugarlabs.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: "Discussion of Sugar development and other technical matters."
	<sugar-devel.lists.sugarlabs.org>
List-Unsubscribe: <http://lists.sugarlabs.org/options/sugar-devel>,
	<mailto:sugar-devel-request@lists.sugarlabs.org?subject=unsubscribe>
List-Archive: <http://lists.sugarlabs.org/archive/sugar-devel>
List-Post: <mailto:sugar-devel@lists.sugarlabs.org>
List-Help: <mailto:sugar-devel-request@lists.sugarlabs.org?subject=help>
List-Subscribe: <http://lists.sugarlabs.org/listinfo/sugar-devel>,
	<mailto:sugar-devel-request@lists.sugarlabs.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: sugar-devel-bounces@lists.sugarlabs.org
Errors-To: sugar-devel-bounces@lists.sugarlabs.org

Cairo.Context.arc needs the angle in radians instead of degrees. Give
it as 360 (radians) was taking up to 8 seconds to draw the eyes.

Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
---
 eye.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/eye.py b/eye.py
index 954e68a..e1bf5b8 100644
--- a/eye.py
+++ b/eye.py
@@ -125,18 +125,20 @@ class Eye(gtk.DrawingArea):
         self.context.fill()
 
         # eye ball
-        self.context.arc(bounds.width / 2, bounds.height / 2, eyeSize / 2 - outlineWidth / 2, 0, 360)
+        self.context.arc(bounds.width / 2, bounds.height / 2,
+                         eyeSize / 2 - outlineWidth / 2, 0, 2 * math.pi)
         self.context.set_source_rgb(1, 1, 1)
         self.context.fill()
 
         # outline
         self.context.set_line_width(outlineWidth)
-        self.context.arc(bounds.width / 2, bounds.height / 2, eyeSize / 2 - outlineWidth / 2, 0, 360)
+        self.context.arc(bounds.width / 2, bounds.height / 2,
+                         eyeSize / 2 - outlineWidth / 2, 0, 2 * math.pi)
         self.context.set_source_rgb(0, 0, 0)
         self.context.stroke()
 
         # pupil
-        self.context.arc(pupilX, pupilY, pupilSize, 0, 360)
+        self.context.arc(pupilX, pupilY, pupilSize, 0, 2 * math.pi)
         self.context.set_source_rgb(0, 0, 0)
         self.context.fill()
 
-- 
1.7.11.7

_______________________________________________
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel